package acm.蓝桥5;

import java.util.BitSet;
import java.util.Scanner;

public class 砝码方案 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        n = sc.nextInt();
        w=new int[n];
        int sum=0;
        for (int i = 0; i < n; i++) {
            w[i]=sc.nextInt();
            sum+=w[i];
        }
        dp=new boolean[n+1][sum+1];
        dfs(0,0);
        set.set(0,false);
        System.out.println(set.cardinality());
    }
    static int[] w;
    static int n;
    static BitSet set=new BitSet();
    static boolean[][] dp;
    public static void dfs(int i,int sum){
        if (dp[i][sum]) return;
        dp[i][sum]=true;
        if (i==w.length){
            set.set(sum);
            return;
        }
        dfs(i+1,sum+w[i]);
        dfs(i+1,Math.abs(sum-w[i]));
        dfs(i+1,sum);
    }
}
